<?php
/**
 * Created by PhpStorm.
 * User: cxj
 * Date: 16/12/30
 * Time: 下午3:36
 */
namespace app\models;

use yii\db\ActiveRecord;

class Activity extends ActiveRecord{
    public function getPosterCover(){
    }

    public function getActivities(){
        return Activity::find()->where(['del_flag' => '1'])->asArray()->all();
    }
    public function getByStatus($status){
        return Activity::find()->where(['status'=>$status,'del_flag' => '1'])->asArray()->all();
    }

    public function getActivityByPageNum($activityArr,$pageNum){
        return array_slice($activityArr,2*($pageNum-1),2);
    }

    public function getById($id){
        return Activity::find()->where(['id'=>$id])->asArray()->all();
    }

    public function getOverTime(){
        return Activity::find()->select('over_time')->where(['del_flag' => '1'])->asArray()->all();
    }
}